<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>三列布局示例</title>
<style>
  * {
    box-sizing: border-box; /* 确保宽高包含padding和border */
  }

  #container {
    width: 100%;
    padding: 0;
    margin: 0;
  }

  #header, #footer {
    background-color: #333;
    color: rgb(232, 125, 18);
    padding: 10px;
    text-align: center;
  }

  #middle {
    display: flex;
    flex-direction: row;
    justify-content: space-between; /* 三列之间保持间距 */
  }

  #column1, #column2, #column3 {
    width: 33.33%;
    background-color: #5af30e;
    padding: 200px;
    border: 1px solid #08eaed; /* 边框 */
  }

  /* 响应式布局 */
  @media (max-width: 768px) {
    /* 当屏幕宽度小于768px时，中间栏变为堆叠布局 */
    #middle {
      flex-direction: column;
    }

    #column1, #column2, #column3 {
      width: 100%; /* 三列宽度调整为100% */
      margin-bottom: 20px; /* 添加底部间距 */
    }
  }
</style>
</head>
<body>

<div id="container">
  <div id="header">页眉内容</div>
  <div id="middle">
    <div id="column1">第一列内容</div>
    <div id="column2">第二列内容</div>
    <div id="column3">第三列内容</div>
  </div>
  <div id="footer">页脚内容</div>
</div>

</body>
</html>